/*
 * @Author: guxf
 * @Date: 2021-11-25 12:47:22
 * @Description: 用户相关接口
 */
import request from "@/utils/request.js";
const api = {
	page: '/applet/goodsType/page',
	addOrUpdate: '/applet/goodsType/addGoodsType',
	selectGoodsType: '/applet/goodsType/selectGoodsType',
	deleteById: '/applet/goodsType/',
	getSearchKeyword: '/applet/search/selectHotGoods'
}
export function getSearchKeyword(parameter) {
	return request({
		method: "get",
		url: api.getSearchKeyword
	});
}

export function page(parameter) {
	return request({
		url: api.page,
		method: 'POST',
		data: parameter
	})
}
//根据shopId获取
export function selectGoodsType(parameter) {
	let params = parameter ? '/' + parameter : '';
	return request({
		method: "get",
		url: api.selectGoodsType + params
	});
}
/**
 * @desc 新增或刪除
 */
export function addOrUpdate(data) {
	return request({
		method: "POST",
		url: api.addOrUpdate,
		data,
	});
}
export function deleteById(parameter) {
	return request({
		method: "delete",
		url: api.deleteById + parameter,
	});
}
